package com.bookcity.front.webfront.service.impl;

import com.bookcity.front.webfront.domain.Section;
import com.bookcity.front.webfront.mapper.SectionMapper;
import com.bookcity.front.webfront.service.ISectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 章节Service业务层处理
 * 
 * @author laoliu
 * @date 2023-05-07
 */
@Service
public class SectionServiceImpl implements ISectionService 
{
    @Autowired
    private SectionMapper sectionMapper;

    /**
     * 查询章节
     * 
     * @param id 章节主键
     * @return 章节
     */
    @Override
    public Section selectSectionById(Long id)
    {
        return sectionMapper.selectSectionById(id);
    }

    /**
     * 查询章节列表
     * 
     * @param section 章节
     * @return 章节
     */
    @Override
    public List<Section> selectSectionList(Section section)
    {
        return sectionMapper.selectSectionList(section);
    }

    /**
     * 新增章节
     * 
     * @param section 章节
     * @return 结果
     */
    @Override
    public int insertSection(Section section)
    {
        return sectionMapper.insertSection(section);
    }

    /**
     * 修改章节
     * 
     * @param section 章节
     * @return 结果
     */
    @Override
    public int updateSection(Section section)
    {
        return sectionMapper.updateSection(section);
    }

    /**
     * 批量删除章节
     * 
     * @param ids 需要删除的章节主键
     * @return 结果
     */
    @Override
    public int deleteSectionByIds(Long[] ids)
    {
        return sectionMapper.deleteSectionByIds(ids);
    }

    /**
     * 删除章节信息
     * 
     * @param id 章节主键
     * @return 结果
     */
    @Override
    public int deleteSectionById(Long id)
    {
        return sectionMapper.deleteSectionById(id);
    }

    @Override
    public List<Section> selectSections(Long bid) {
        return this.sectionMapper.selectSections(bid);
    }

    @Override
    public Section selectNextSection(Long sid) {
        return this.sectionMapper.selectNextSection(sid);
    }
}
